package leetcodecompetition.S107;

import java.util.HashSet;
import java.util.Set;

/**
 * @Author: Siantar
 * @Date: 2023-06-24-23:23
 * @Description: 1.0
 */
public class T6892 {
    public int maximumNumberOfStringPairs(String[] words) {
        int res=0;
        Set<String> set=new HashSet<>();
        for (String s : words) {
            if (set.contains(s)){
                res++;
                set.remove(s);
            }else {
                set.add(new StringBuffer(s).reverse().toString());
            }
        }
        return res;
    }
}
